﻿// Global namespace
var MasterStroke = MasterStroke || {};

define
(
    ["./Point"],
    function ()
    {
        MasterStroke.Shape = function (shape)
        {
            if (!(shape instanceof fabric.Object))
            {
                throw "shape must be a fabric object";
            }

            var _shape = shape;

            this.getShape = function ()
            {
                return _shape;
            };

            this.getControlPoints = function ()
            {
                var points = [];
                if (_shape instanceof fabric.Circle)
                {
                    points.push(new MasterStroke.Point(_shape.left, _shape.top));
                }

                return points;
            };

            this.toJSON = function()
            {
                return _shape.toObject();
            }
        };

        return MasterStroke.Point;
    }
);